<include file="public/header" />
<include file="public/left" />
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="flexigrid">

        <div class="mDiv">
            <div class="ftitle">
                <h3>司机列表</h3>
                <h5>(共{$count}条记录)</h5>
            </div>
            <div title="刷新数据" class="pReload"><i class="fa fa-refresh"></i></div>
            <form class="navbar-form form-inline" action="" method="get">
                <div class="sDiv">
                    <div class="sDiv2">

                        <select name="status" class="select">
                            <option value="">全部状态</option>
                            <option value="0" <eq name="status" value="0">selected </eq>>待审状态</option>
                            <option value="1" <eq name="status" value="1">selected </eq>>通过状态</option>
                            <option value="-1" <eq name="status" value="-1">selected </eq>>不通过状态</option>
                        </select>
                        <!--<input type="text" class="qsbox" name="keyword" placeholder="可搜索昵称或手机号码" value="{$keyword}">-->
                        <input  class="btn"type="submit" value="搜索">
                    </div>
                </div>
            </form>
        </div>

        <div class="hDiv">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0">
                    <thead>
                    <tr>
                        <th class="sign" axis="col0">
                            <div style="width: 24px;"><i class="ico-check"></i></div>
                        </th>
                        <th align="left" abbr="article_title" axis="col3" class="">
                            <div style="text-align: left; width: 100px;" class="">ID</div>
                        </th>
                        <th align="left" abbr="ac_id" axis="col4" class="">
                            <div style="text-align: left; width: 200px;" class="">司机名称</div></th>
                        <th align="left" abbr="ac_id" axis="col4" class="">
                            <div style="text-align: left; width: 100px;" class="">手机号码</div></th>
                        <th align="left" abbr="ac_id" axis="col4" class="">
                            <div style="text-align: left; width: 100px;" class="">身份证</div></th>
                        <th align="left" abbr="ac_id" axis="col4" class="">
                            <div style="text-align: left; width: 100px;" class="">银行卡号</div></th>
                        <th align="left" abbr="ac_id" axis="col4" class="">
                            <div style="text-align: left; width: 100px;" class="">车牌号</div></th>
                        <th align="left" abbr="ac_id" axis="col4" class="">
                            <div style="text-align: left; width: 200px;" class="">地址</div></th>
                        <th align="left" abbr="ac_id" axis="col4" class="">
                            <div style="text-align: left; width: 120px;" class="">申请时间</div></th>
                        <th align="left" abbr="ac_id" axis="col4" class="">
                            <div style="text-align: left; width: 60px;" class="">状态</div></th>
                        <th align="left" abbr="ac_id" axis="col4" class="">
                            <div style="text-align: left; width: 60px;" class="">证件状态</div></th>
                        <th align="center" axis="col1" class="handle">
                            <div style="text-align: center; width: 150px;">操作</div>
                        </th>
                        <th style="width:100%" axis="col7">
                            <div></div>
                        </th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
        <!--	<div class="tDiv">
                <div class="tDiv2">
                    <div class="fbutton">
                        <a href="{:url('center/detail')}">
                            <div class="add" title="新增会员">
                                <span><i class="fa fa-plus"></i>新增会员</span>
                            </div>
                        </a>
                    </div>
                </div>
                <div style="clear:both"></div>
            </div>-->
        <div class="bDiv" style="height: auto;">
            <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
                <table>
                    <tbody>
                    <foreach name="list" item="vo" key="k" >
                        <tr>
                            <td class="sign">
                                <div style="width: 24px;"><i class="ico-check"></i></div>
                            </td>
                            <td align="left" class="">
                                <div style="text-align: left; width: 100px;">{$vo.id}</div>
                            </td>
                            <td align="left" class="">
                                <div style="text-align: left; width: 200px;"><img src="{$vo.driver.headimage}" style="height: 20px;">{$vo.driver.nickname}-<eq name="vo.driver.sex" value="1">男<else />女</eq></div>
                            </td>
                            <td align="left" class="">
                                <div style="text-align: left; width: 100px;">{$vo.driver.mobile}</div>
                            </td>
                            <td align="left" class="">
                                <div style="text-align: left; width: 100px;">{$vo.driver.idcard_number}</div>
                            </td>
                            <td align="left" class="">
                                <div style="text-align: left; width: 100px;">{$vo.driver.bank}{$vo.driver.card_num}</div>
                            </td>
                            <td align="left" class="">
                                <div style="text-align: left; width: 100px;">{$vo.driver.cart_number}</div>
                            </td>
                            <td align="left" class="">
                                <div style="text-align: left; width: 200px;">{$vo.driver.province}{$vo.driver.city}{$vo.driver.county}{$vo.driver.street}</div>
                            </td>
                            <td align="left" class="">
                                <div style="text-align: left; width: 120px;">{$vo.creatime|date="Y-m-d H:i:s", ###}</div>
                            </td>
                            <td align="left" class="">
                                <div style="text-align: left; width: 60px;">
                                    <switch name="vo.status">
                                        <case value="0"><span style="color:red">待审核</span></case>
                                        <case value="1"><span style="color:green">已通过</span></case>
                                        <case value="-1"><span style="color:#ccc">不通过</span></case>
                                    </switch>
                                </div>
                            </td>
                            <td align="center" class="handle">
                                <div style="text-align: center; width: 270px; max-width:270px;">
                                    <eq name="$vo['status']" value='0'>
                                        <a class="btn red"  href="javascript:void(0)" data-url="{:url('set/drivercheck')}" data-id="{$vo.id}" data-name="确定证件审核通过?"  data-status="1"  onclick="checkfun(this)"><i class="fa fa-clock-o"></i>通过</a>
                                        <a class="btn red"  href="javascript:void(0)" data-url="{:url('set/drivercheck')}" data-name="确定证件审核不通过?" data-id="{$vo.id}" data-status="-1" onclick="checkfun(this)"><i class="fa fa-clock-o"></i>禁止</a>
                                    </eq>
                                    <eq name="$vo['status']" value='1'>
                                        <a class="btn red"  href="javascript:void(0)" data-url="{:url('set/undriver')}" data-name="确定与该司机解约,解约后他将不为你服务?" data-id="{$vo.id}" data-status="0" onclick="checkfun(this)"><i class="fa fa-clock-o"></i>解约</a>
                                    </eq>
                                    <a class="btn green" href="{:url('Set/driverinfo',array('id'=>$vo.driver_id))}"><i class="fa fa-list-alt"></i>查看司机</a>
                                </div>
                            </td>
                            <td align="" class="" style="width: 100%;">
                                <div>&nbsp;</div>
                            </td>
                        </tr>
                    </foreach>
                    </tbody>
                </table>
            </div>
            <div class="iDiv" style="display: none;"></div>
        </div>
        {$list->render()}
        <!--分页位置-->
    </div>
</div>
<script>
    $(document).ready(function(){
        // 表格行点击选中切换
        $('#flexigrid > table>tbody >tr').click(function(){
            $(this).toggleClass('trSelected');
        });
        // 点击刷新数据
        $('.pReload').click(function(){
            location.href = location.href;
        });
        $(".credit").click(function(){
            $(this).hide();
            $(this).siblings("input").prop("type","number");
        });
        $(".credit_input").keydown(function(e){
            var ev = document.all ? window.event : e;
            if (ev.keyCode == 13) {
                var str = $(this);
                var id = $(this).data("id");
                var a = new Number($(this).val());
                var num = a.toFixed(2);
                $.post("{:url('center/credit')}", {id: id, num: num}, function (result) {
                    if (result == 1) {
                        str.prop("type", "hidden");
                        str.val(num);
                        str.siblings("span").show();
                        str.siblings("span").html(num);
                    } else {
                        alert('系统繁忙，稍后再试');
                    }
                });

            }
        })
    });
    function delfun(obj) {
        // 删除按钮
        var confirm=$(obj).attr('data-name');
        layer.confirm(confirm, {
            btn: ['确定', '取消'] //按钮
        }, function () {
            $.ajax({
                type: 'post',
                url: $(obj).attr('data-url'),
                data : {id:$(obj).attr('data-id')},
                dataType: 'json',
                success: function (data) {
                    if (data == 1) {
                        $(obj).parent().parent().parent().remove();
                        layer.closeAll();
                        window.location.reload();
                    } else {
                        layer.alert('操作失败', {icon: 2});  //alert('删除失败');
                    }
                }
            })
        }, function () {
        });
    }
    function blackfun(obj) {
        // 删除按钮
        var confirm=$(obj).attr('data-name');
        layer.confirm(confirm, {
            btn: ['确定', '取消'] //按钮
        }, function () {
            $.ajax({
                type: 'post',
                url: $(obj).attr('data-url'),
                data : {id:$(obj).attr('data-id')},
                dataType: 'json',
                success: function (data) {
                    if (data == 1) {
                        window.location.reload();
                    } else {
                        layer.alert('操作失败', {icon: 2});  //alert('删除失败');
                    }
                }
            })
        }, function () {
        });
    }
    function checkfun(obj) {
        var confirm=$(obj).attr('data-name');
        layer.confirm(confirm, {
            btn: ['确定', '取消'] //按钮
        }, function () {
            $.ajax({
                type: 'post',
                url: $(obj).attr('data-url'),
                data : {id:$(obj).attr('data-id'),status:$(obj).attr('data-status')},
                dataType: 'json',
                success: function (data) {
//                    console.log(data);
                    if (data == 1) {
                        window.location.reload();
                    } else {
                        layer.alert(data, {icon: 2});  //alert('删除失败');
                    }
                }
            })
        }, function () {
        });
    }
</script>
</body>
</html>
</html>